package ch1.ex8;

class StaticTest{
	static int i = 47;
}
class Incrementator{
	static void increment(){
		StaticTest.i++;
	}
}

public class OneStaticTest {
	public static void main(String[] args){
		System.out.println(" Variable 'i' has initial value: " + StaticTest.i);
		StaticTest st1 = new StaticTest();
		StaticTest st2 = new StaticTest();
		System.out.println(" Variable 'st1' value: " + st1.i);
		System.out.println(" Variable 'st2' value: " + st2.i);
		Incrementator.increment();
		System.out.println(" After invoking of Incrementator.increment() function: ");
		System.out.println(" Variable 'st1' value: " + st1.i);
		System.out.println(" Variable 'st2' value: " + st2.i);
		st1.i = 3;
		System.out.println(" After setting 'st1.i = 3': ");
		System.out.println(" Variable 'st1' value: " + st1.i);
		System.out.println(" Variable 'st2' value: " + st2.i);
		StaticTest inc = new StaticTest();
		System.out.println(" Variable 'inc' value: " + inc.i);
	}
}
